// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import "./assets/css/index.css";
import "./assets/css/iconfont.css";
import "./assets/css/markdown.css";
import "./assets/css/vue-social-share/client.css";
import "highlight.js/styles/atom-one-dark.css";
import VueImageSwipe from "vue-image-swipe";
import 'vue-image-swipe/dist/vue-image-swipe.css'
import Vuetify from 'vuetify'
import vuetify from '@/plugins/vuetify'
import axios from "axios";
import VueAxios from "vue-axios";
import tagCloud from 'v-tag-cloud'
Vue.use(Vuetify)
Vue.config.productionTip = false
Vue.use(VueAxios, axios);
Vue.use(VueImageSwipe);
Vue.use(tagCloud)
/* eslint-disable no-new */


router.afterEach((to, from, next) => {
  window.scrollTo(0, 0);
});
axios.interceptors.response.use(
  function(response) {
    switch (response.data.code) {
      case 50000:
        Vue.prototype.$toast({ type: "error", message: "系统异常" });
    }
    return response;
  },
  function(error) {
    return Promise.reject(error);
  }
);

axios.defaults.baseURL = 'http://39.108.152.84:8080' //全局方式生成环境使用的地址
new Vue({
  el: '#app',
  router,
  vuetify:vuetify,
  components: { App },
  template: '<App/>'
})
